package com.hankol.community.adapter

import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.hankol.community.R

/**
 * @author: 关忆北、
 * @date: 2022/5/5
 * @Des：讲坛视频详情--【详情】【评论】 两个tab
 */
class PulVideoTabAdapter : BaseQuickAdapter<String, BaseViewHolder>(R.layout.item_pulvideo_tab) {
    private var selectPos = 0;

    override fun convert(helper: BaseViewHolder, item: String) {
        val mTvPulTab = helper.getView<TextView>(R.id.tv_pul_tab)
        mTvPulTab.text = item
        if (selectPos == helper.adapterPosition) {
            mTvPulTab.paint.isFakeBoldText = true
            mTvPulTab.setTextColor(mContext.resources.getColor(R.color.color_333333))
        } else {
            mTvPulTab.paint.isFakeBoldText = false
            mTvPulTab.setTextColor(mContext.resources.getColor(R.color.color_999999))
        }
    }


    fun setSelectPos(pos: Int) {
        this.selectPos = pos
        notifyDataSetChanged()
    }


}